package cn.wp.ewallet.wmps.dao.impl;

import cn.wp.common.core.dao.JdbcSupportTemplate;
import cn.wp.common.core.dao.SqlString;
import cn.wp.ewallet.wmps.dao.FixFinaProdInfoDao;
import cn.wp.ewallet.wmps.model.entity.FixFinaProdInfoDo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * 定期理财产品-数据访问层实现
 * Created by ganjie on 2020/01/11
 */
@Repository
public class FixFinaProdInfoDaoImpl implements FixFinaProdInfoDao {

    @Autowired
    private JdbcSupportTemplate jdbcSupportTemplate;

    @Override
    public FixFinaProdInfoDo selectfixFinaProdInfo(String finaProdId) {
        SqlString sqlString = SqlString.newInstance();
        sqlString.add("SELECT * from FIX_FINA_PROD_INFO where FINA_PROD_ID = ?");
        return jdbcSupportTemplate.selectObject(sqlString.build(),new Object[]{finaProdId},FixFinaProdInfoDo.class);
    }

    @Override
    public void insertFixFinaProdInfo(FixFinaProdInfoDo fixFinaProdInfoDo) {
        jdbcSupportTemplate.insert(fixFinaProdInfoDo);
    }

    @Override
    public void updateFixFinaProdInfo(FixFinaProdInfoDo fixFinaProdInfoDo) {
        jdbcSupportTemplate.updateSelective(fixFinaProdInfoDo);
    }
}

